package com.qs.cwams.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @Description : TODO
 * @Author : huwei
 * @Date : 2022/07/22 17:22
 */
@Configuration
@ConfigurationProperties(prefix = "lonni.resource")
public class IgnorenPath {

    private static Set<String> igpath = new HashSet();

    public IgnorenPath() {
        igpath.add("/**");
    }

    private String id;
    private List<String> ignoredPath;

    private String[] allIgnoredPath;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public List<String> getIgnoredPath() {
        return ignoredPath;
    }

    public void setIgnoredPath(List<String> ignoredPath) {
        this.ignoredPath = ignoredPath;
    }

    public String[] getAllIgnoredPath() {
        System.out.println("执行getAllIgnoredPath.....");
        if (this.ignoredPath != null && !this.ignoredPath.isEmpty()) {
            this.ignoredPath.forEach(p->{
                igpath.add(p);
            });
        }
        return igpath.toArray(new String[igpath.size()]);
    }

    public void setAllIgnoredPath(String[] allIgnoredPath) {

    }
}
